<?php
echo $form->create('EmailConfig',array('url'=>'/'.$this->params['url']['url'],'enctype'=>'multipart/form-data'));
echo $form->inputs(array('fieldset'=>false),null,'add');
echo $form->end(__('Save'));
?>
<script type="text/javascript">
$(document).ready(function()
{
	toggleFields('#EmailConfigType');
	$('#EmailConfigType').change(function()
	{
		toggleFields('#EmailConfigType');
	});
	
});
function toggleFields(caller)
{
	if($(caller).val() == 'mail')
	{
		$('.toggleField').parent().hide();
	}else
	{
		$('.toggleField').parent().show();
	}
}
</script>